<?php get_header(); ?>        
    
<?php if(get_option('pr_slider')=='true'){  get_template_part('/includes/slider'); }?>

<div class="main_content <?php if(get_option('pr_slider')!='true'){ echo'padd'; }?>">
    <div id="primary" <?php if(get_option('pr_full_home')=='true'){ echo 'class="full_width"'; }?>>       

<?php if(get_option('pr_intro')=='true'){ get_template_part('/includes/welcome'); }?>
        
       <div class="pro_reviews">
<?php 
$num=get_option('pr_reviews_hno'); 
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
$wp_query->query('posts_per_page=' . $num . '&post_type=reviews');
if($wp_query->have_posts()) : while ($wp_query->have_posts()) : $wp_query->the_post();

// usually needed
global $custom_metabox;

$meta = get_post_meta(get_the_ID(), $custom_metabox->get_the_ID(), TRUE); 

 
?>            
            <div class="single_review">
            <?php if($meta['r_ribbon']!=''){ ?>
                <div class="ribbon">
                    <img src="<?php echo get_template_directory_uri();?>/images/<?php echo $meta['r_ribbon']; ?>.png" alt="recommended" />
                </div><!--end ribbon-->
           <?php } ?>     
                <div class="review_data">
                <div class="preload_image">
                    <a class="single_image" href="<?php $links=wp_get_attachment_image_src( get_post_thumbnail_id($post->ID),full); echo $links[0]; ?>"><img src="<?php print_thumbnail_src('280','180') ?>" alt="single_review" /></a>
                </div><!--end preload-->
                <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                <p class="prod_meta">
                <?php echo get_the_term_list( get_the_ID(), 'review-cats', '', ',', '' ) ?> 
                </p>

                <?php echo $meta['r_description']; ?>
                </div><!--end review_data-->
                <div class="review_bottom">
                    <div class="review_rating stars_<?php echo $meta['r_rating']; ?>">
                    <?php echo $meta['r_rating']; ?> stars
                    </div><!--end review_rating-->

                 <!-- <a href="<?php echo $meta['r_aff_link']; ?>" class="visit" target="_blank"><span>Read Full Review</span></a>-->
                                     <div class="link_buttons">
                                    <<a href="<?php the_permalink(); ?>" class="read"><span>Read Review</span></a>

                                         <!-- <div class="dscount"><a href="http://www.google.com/""><?php echo $meta['r_aff_link']; ?></a></div>-->
<div class="dscount">10% discount </div>

<div id="uniquename2" class="dscount">
<a href="/wordpress/test2" onclick="javascript:HideContent('uniquename2') ;ShowContent('uniquename')" target="blank"><img src="http://www.ecigadvanced.com/wp-content/themes/Ecig_newtheme/images/show_coupon.jpg"</img>
</a></div>       

<div id="uniquename" style="display:none;">                             
<div class="coupon_home showcoupon" style="margin-top: 0px; width: 152px; text-align: left;">
<div id="show" class=""><a target="_blank" title="Click to open our affiliate site for your price" href="/wordpress/test2"><span style="font-size: 11px ! important;">Coupon Code:</span><br/>disc10-19725<br/><span style="font-size: 10px ! important;">Click to Open</span></a></div></div>
</div>            
              
                    
                    
                    </div><!--end link_buttons-->
                </div><!--end review_bottom-->
            </div><!--end single_review-->
<?php if(get_option('pr_banner_img') && get_option('pr_banner_link')){ ?>
<?php $i++; if($i==1){ if(get_option('pr_banner_img')) {?>            
            <div class="reviews_banner">
              <a href="<?php echo get_option('pr_banner_link'); ?>"><img src="<?php echo get_option('pr_banner_img'); ?>" alt="banner2" align="middle" /></a>
            </div>
<?php }}} ?>

<?php endwhile; endif; wp_reset_query(); ?>        
     
            <div class="reviews_pagination"><a href="<?php echo get_permalink(get_option('pr_reviews_ID')); ?>">Read more reviews</a></div><!--end reviews_pagination-->
        </div><!--end pro_reviews-->
        
        <div class="standard_post_items">
<?php  
$number=get_option('pr_blog_hno');
       
        query_posts('showposts=' . $number); //.get_cat_ID($cat)
        if (have_posts()) : while (have_posts()) : the_post();
        
?>
            <div class="post_item">
                <h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                <p class="post_meta">Posted by: <?php the_author();?>   on <?php the_time('F j, Y');?>   Under: <?php echo get_the_term_list( $post->ID, 'category', '', ', ', '' ); ?></p>
                <?php echo theme_excerpt('480','Read More...'); ?>
            </div><!--end post_item-->
<?php endwhile; endif; wp_reset_query(); ?>            
            
            <div class="posts_pagination">
            <a href="<?php echo get_permalink(get_option('pr_blog_ID')); ?>">Read more articles</a></div>
        </div><!--end standard_post_items-->
        </div><!--end primary-->
       
<?php if(get_option('pr_full_home')!='true'){  get_sidebar(); } ?>

        </div><!--end main_content-->
        
<?php get_footer(); ?>